-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let filt
/filt!
return state if provided as input
#599
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #599 +/- ##
=======================================
Coverage 97.91% 97.92%
=======================================
Files 19 19
Lines 3262 3272 +10
=======================================
+ Hits 3194 3204 +10
Misses 68 68 ☔ View full report in Codecov by Sentry. |
939cfb3
to
33fcd97
Compare
Would it be too radical to remove
|
I've been wondering the same. I'll give it try and open an alternative PR if it looks promising. EDIT: PR up at #603.
Another point in favor of a
Right. That would allow the return-type to remain the same, but then this might be silently breaking, i.e. the same code still works, but produces different results. We might want to avoid that. Also,
We could make that orthogonal by introducing some state-setup function that could both play the role of |
33fcd97
to
e1d5caa
Compare
e1d5caa
to
6d5e1e5
Compare
Superseded by #603. |
As argued in #372 (comment), I don't think the possibility to pass in state to
filt
andfilt!
in the current form is very helpful, as there is no supported way of obtaining such state. There is the internal_zerosi
, but explicitly passing the zero-state is equivalent to passing no state, so why bother. Otherwise, the filter state should probably be considered an implementation detail and it is undocumented, so hand-crafting it is not recommended. (With the exception of the use in DSPs ownfiltfilt
, maybe.) The most likely use of passing in state is to resume a filtering operation, e.g. for blockwise processing. (Yes, that's what using aDF2TFilter
allows, too.) But to enable that, one would need the final state to be provided byfilt
/filt!
.And that's what this PR does, but only if an input state is provided. I.e. one can do
The implementation is somewhat rough-and-dirty for now, as I first wanted to get a feel for this and see if we want to do this. There are some questions on the API worth thinking about:
_zerosi
public (with a better name)? Or support some placeholder value for thestate
parameter that indicates a zero-state should be set up?filt!
modify thestate
instead of returning it? Seems reasonable, but up to now, care was taken not to modify the state.Putting on the milestone as this would be breaking.